import { createBrowserRouter } from 'react-router-dom'
import {  lazy } from 'react'
import {
    HomeOutlined,
} from '@ant-design/icons';
let Login = lazy(() => import('../pages/login/Index'))
let Btnchange = lazy(() => import('../pages/btnchange/Index'))
let Selchange = lazy(() => import('../pages/selchange/Index'))
let Error = lazy(() => import('../pages/error/Index'))
let Home = lazy(() => import('../pages/home/Index'))
let Layout = lazy(() => import('../pages/layout/Index'))
let Order = lazy(() => import('../pages/order/Index'))

export let routechild = [
    {
        path: '/',
        element: <Home></Home>,
        label: '表格',
        icon: <HomeOutlined />

    },
    {
        path: '/order',
        element: <Order></Order>,
        label: '双飞翼',
        icon: <HomeOutlined />

    },
    {
        path: '/zhuti',
        label: '主题',
        icon: <HomeOutlined />,
        children: [
            {
                path: '/zhuti/btnchange',
                element: <Btnchange></Btnchange>,
                label: '按钮切换',
                icon: <HomeOutlined />

            },
              {
                path: '/zhuti/selchange',
                element: <Selchange></Selchange>,
                label: '下拉切换',
                icon: <HomeOutlined />

            },
        ]

    },
]

let route = createBrowserRouter([
    {
        path: '/',
        element: <Layout></Layout>,
        children: routechild,
    },
    {
        path: '/login',
        element:<Login></Login>
    },
    {
        path: '*',
        element:<Error></Error>
    },
])

export default route